package com.gopay.common.id;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Properties;

/**
 * 服务Id 构建
 */
public class WorkerIdGenerator implements Generator<WorkerId> {

    private Logger logger = LoggerFactory.getLogger(WorkerIdGenerator.class);

    private WorkerId workerId;


    public WorkerIdGenerator(Properties prop) {
        workerId = new WorkerId(prop.getProperty("service"), prop.getProperty("serviceId"));
    }

    @Override
    public WorkerId generator() {
        return workerId;
    }
}
